package com.server.questionbank.snframe.config.minio;

import io.minio.MinioClient;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Config {
    @Resource
    MinIoProperties minIoProperties;

    //注入MinioClient
    @Bean
    public MinioClient minioClient(){
        return MinioClient.builder().endpoint(minIoProperties.getUrl())
                .credentials(minIoProperties.getAccessKey(),minIoProperties.getSecretKey())
                .build();
    }
}
